package com.example.demo.controller;

import com.example.demo.common.R;
import com.example.demo.entity.vo.Statistic;
import com.example.demo.service.StatisticsService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

/**
 * @author liye
 * @date 2025/10/10 10:52
 * @description:
 */
@RestController
@RequestMapping("/statistics")
public class StatisticsController {
    @Resource
    private StatisticsService statisticsService;
    /**
     * 统计每个院区的医生人数
     * @return
     */
    @GetMapping("/areaCountDoctor")
    public R areaCountDoctor(){
        HashMap<String, Object[]> map=statisticsService.areaCountDoctor();
        return R.success(map);
    }

    @GetMapping("/areaCountDept")
    public R areaCountDept(){
       List<Statistic> list=statisticsService.areaCountDept();
        return R.success(list);
    }
}
